# for i in range(1,32):
#     print("else if(cnt == %d) begin" % i)
#     print("  x0_i = K[%d];" % i)
#     print("  x1_i = K[%d];" % (i+1))
#     print("  x2_i = K[%d];" % (i+2))
#     print("  x3_i = K[%d];" % (i+3))
#     print("  rk_i = CK[%d];" % i)
#     print("end")
# for i in range(0,32):
#     print("%d : begin" % i)
#     print("    x0_i = X_iter[%d];" % i)
#     print("    x1_i = X_iter[%d];" % (i+1))
#     print("    x2_i = X_iter[%d];" % (i+2))
#     print("    x3_i = X_iter[%d];" % (i+3))
#     print("    rk_i = (Mode_i)? RK[%d] : RK[%d];" % (i,31-i))
#     print("end")

for i in range(0,32):
    print("%d : begin" % i)
    print("    x0_i = (!mode_i[0])? K[%d] : X_iter[%d];" % (i,i))
    print("    x1_i = (!mode_i[0])? K[%d] : X_iter[%d];" % (i+1,i+1))
    print("    x2_i = (!mode_i[0])? K[%d] : X_iter[%d];" % (i+2,i+2))
    print("    x3_i = (!mode_i[0])? K[%d] : X_iter[%d];" % (i+3,i+3))
    print("    rk_i = (!mode_i[0])? CK[%d]  :" % i)
    print("            (mode_i[1])? K[%d]   : K[%d];" % (i+4,35-i))
    print("end")